package service;

import java.util.List;

import cjgl.dao.TbClassDAO;
import cjgl.entity.Course;
import cjgl.entity.Student;
import cjgl.entity.TbClass;

public class TbClassService {
        private TbClassDAO classDAO=new TbClassDAO();



		public void delete(Integer id) {
			classDAO.delete(id);
		}

		public TbClass findById(Integer id) {
			return classDAO.findById(id);
		}

		public List<TbClass> findAll() {
			return classDAO.findAll();
		}
		public void sava(TbClass tbClass) {
			Integer id=tbClass.getId();
			if(id==null) {
				classDAO.insert(tbClass);
			}else {
				classDAO.update(tbClass);
			}
	    
		}  
		 public void delete(TbClass tbClass) {
		    	classDAO.delete(tbClass.getId());
		    	
		    
			}
        
        
}
